<?php
class Voitech_Paginator {
	protected $arrData;
	protected $list;
	protected $page;
	
	public function __construct($arrData,$list,$page) {
		$this->arrData = $arrData;
		$this->list = $list;
		$this->page = $page;
	}
	
	public function paginar($default=null){
            $objCache				=	Zend_Registry::get('cachePaginator');
            $nuList					=	$this->list;        
            $intList				=	( isset( $nuList ) && $nuList != null ) ? $nuList : $default;
            $objPaginator = Zend_Paginator::factory( $this->arrData );
            $objPaginator->setCache( $objCache );
            $objPaginator->setCacheEnabled( true );
            $objPaginator->setItemCountPerPage( $intList );
            $objPaginator->setCurrentPageNumber( $this->page );
            $objPaginator->setDefaultScrollingStyle( 'All' );
            Zend_View_Helper_PaginationControl::setDefaultViewPartial('paginator_ajax.phtml');
            return $objPaginator;	
	}
}